using DataDynamics.ActiveReports.Document;
using DataDynamics.ActiveReports.Toolbar;
using DataDynamics.ActiveReports.Viewer;
using Microsoft.Win32;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace TVSBH.func
{
	public class frmOutRetailBillView : Form
	{
		private IContainer components = null;
		private Viewer viewer1;
		public string billID = "";
		public string billDate = "";
		public string cusName = "";
		public string cusAddress = "";
		public string cusPhone = "";
		public string billNote = "";
		public string billTotalMoney = "";
		public string Debt = "";
		public string ALl = "";
		public string TypeBill = "0";
		private bool ExitAffterPrint = false;
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(frmOutRetailBillView));
			this.viewer1 = new Viewer();
			base.SuspendLayout();
			this.viewer1.BackColor = SystemColors.Control;
			this.viewer1.Dock = DockStyle.Fill;
			this.viewer1.Document = new Document("ARNet Document");
			this.viewer1.Location = new Point(0, 0);
			this.viewer1.Name = "viewer1";
			this.viewer1.ReportViewer.CurrentPage = 0;
			this.viewer1.ReportViewer.MultiplePageCols = 3;
			this.viewer1.ReportViewer.MultiplePageRows = 2;
			this.viewer1.ReportViewer.ViewType = ViewType.Normal;
			this.viewer1.Size = new Size(884, 565);
			this.viewer1.TabIndex = 0;
			this.viewer1.TableOfContents.Text = "Table Of Contents";
			this.viewer1.TableOfContents.Width = 200;
			this.viewer1.TabTitleLength = 35;
			this.viewer1.Toolbar.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			this.viewer1.ToolClick += new ToolClickEventHandler(this.viewer1_ToolClick);
			base.AutoScaleDimensions = new SizeF(7f, 15f);
			//base.AutoScaleMode = AutoScaleMode.Font;
			base.ClientSize = new Size(884, 565);
			base.Controls.Add(this.viewer1);
			this.Font = new Font("Arial", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
			//base.Icon = (Icon)componentResourceManager.GetObject("$this.Icon");
			base.KeyPreview = true;
			base.Name = "frmOutRetailBillView";
			base.ShowInTaskbar = false;
			base.StartPosition = FormStartPosition.CenterScreen;
			this.Text = "IN HOÁ ĐƠN";
			base.WindowState = FormWindowState.Maximized;
			base.Load += new EventHandler(this.frmOutRetailBillView_Load);
			base.KeyDown += new KeyEventHandler(this.frmOutRetailBillView_KeyDown);
			base.ResumeLayout(false);
		}
		public frmOutRetailBillView()
		{
			this.InitializeComponent();
		}
		private void frmOutRetailBillView_Load(object sender, EventArgs e)
		{
			try
			{
				RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\TVSGPP", true);
				this.ExitAffterPrint = bool.Parse(registryKey.GetValue("ExitAffterPrint").ToString());
			}
			catch
			{
			}
			if (this.TypeBill == "1")
			{
				frmPrescriptionsBill frmPrescriptionsBill = new frmPrescriptionsBill();
				frmPrescriptionsBill.lblProviderName.Text = this.cusName;
				frmPrescriptionsBill.lvlProviderAddress.Text = this.cusAddress;
				frmPrescriptionsBill.lblVolume.Text = this.cusPhone;
				this.viewer1.Document = frmPrescriptionsBill.Document;
				frmPrescriptionsBill.Run();
			}
			else
			{
				frmOutputRetailBill frmOutputRetailBill = new frmOutputRetailBill();
				frmOutputRetailBill.lblBillID.Text = this.billID;
				frmOutputRetailBill.lblBillDate.Text = this.billDate;
				frmOutputRetailBill.lblBillNote.Text = this.billNote;
				frmOutputRetailBill.lblTotalMoney.Text = "Tổng tiền phải trả : " + this.billTotalMoney;
				frmOutputRetailBill.lblProviderName.Text = this.cusName;
				frmOutputRetailBill.lvlProviderAddress.Text = this.cusAddress;
				frmOutputRetailBill.lblProviderPhone.Text = this.cusPhone;
				this.viewer1.Document = frmOutputRetailBill.Document;
				frmOutputRetailBill.Run();
			}
		}
		private void frmOutRetailBillView_KeyDown(object sender, KeyEventArgs e)
		{
			if (e.KeyCode == Keys.Escape)
			{
				base.Close();
			}
		}
		private void viewer1_ToolClick(object sender, ToolClickEventArgs e)
		{
		}
	}
}
